import Vue from 'vue'
import Router from 'vue-router'
import runnob from '@/components/runnob'
import Index from '../views/index'
import Login from '../views/passport/login'
import refindpass from '../views/passport/refindPass'
import Signin from '../views/passport/signin'
import wechat from '../views/passport/wechat'
import person from '../views/person.vue'
import change_pass from '../views/change_pass.vue'
import edit_point from '../views/edit_point.vue'
import give_question from '../views/give_question.vue'
import question from '../views/questions.vue'
import path from '../views/path.vue'
import apply from '../views/apply.vue'
import checkApply from '../views/checkApply.vue'
import message from '../views/message.vue'
import appoint from '../views/appoint.vue'
import error from '../views/error.vue'
import collection from '../views/collection.vue'
import doExercise from '../views/doExercise.vue'
import allquestion from '../views/allQuestions.vue'
import allanswer from '../views/allAnswer.vue'
import analyse from '../views/data_analyse.vue'
import feedback from '../views/feedback.vue'
import homework from '../views/homework.vue'
import doHomework from '../views/doHomework.vue'
import pointAllQuestion from '../views/pointAllQuestion.vue'
import normalHomework from '../views/normalHomework.vue'
import totalHomework from '../views/totalHomework.vue'
import workDetailPage from '../views/workDetailPage.vue'
import normalHomeworkResult from '../views/normalHomeworkResult.vue'
import homeworkNotHand from '../views/homeworkNotHand.vue'
import homeworkAnswer from '../views/homeworkAnswer.vue'
import demoPractise from '../views/demoPractise.vue'
import Compared from '../views/Compared.vue'
import demoGuide from '../views/demoGuide.vue'
import more_point from '../views/more_point.vue'
import bindEmail from '../views/bindEmail.vue'
import project from '../views/project.vue'
import projects from '../views/projects.vue'
import addProjectStep from '../views/addProjectStep'
import editProjectStep from '../views/editProjectStep'


const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router)

var _required = true
// if (process.env.NODE_ENV === 'development') {
//     _required = false
// }

export default new Router({
    routes: [{
        path: '/doExercise/',
        name: 'doExercise',
        component: doExercise,
        meta: {
            required: _required
        }
    }, {
        path: '/editProjectStep/:menu',
        name: 'editProjectStep',
        component: editProjectStep,
        meta: {
            required: _required
        }
    }, {
        path: '/addProjectStep/:menu',
        name: 'addProjectStep',
        component: addProjectStep,
        meta: {
            required: _required
        }
    }, {
        path: '/projects',
        name: 'projects',
        component: projects,
        meta: {
            required: _required
        }
    }, {
        path: '/project/:menu',
        name: 'project',
        component: project,
        meta: {
            required: _required
        }
    },{
        path: '/bindEmail/',
        name: 'bindEmail',
        component: bindEmail,
        meta: {
            required: _required
        }
    },{
        path: '/Compared/',
        name: 'Compared',
        component: Compared,
        meta: {
            required: _required
        }
    },{
        path: '/demoPractise/',
        name: 'demoPractise',
        component: demoPractise,
        meta: {
            required: _required
        }
    },{
        path: '/homeworkNotHand',
        name: 'homeworkNotHand',
        component: homeworkNotHand,
        meta: {
            required: _required
        }
    },{
        path: '/normalHomeworkResult',
        name: 'normalHomeworkResult',
        component: normalHomeworkResult,
        meta: {
            required: _required
        }
    },{
        path: '/homeworkAnswer',
        name: 'homeworkAnswer',
        component: homeworkAnswer,
        meta: {
            required: _required
        }
    },{
        path: '/demoGuide',
        name: 'demoGuide',
        component: demoGuide,
        meta: {
            required: _required
        }
    },{
        path: '/workDetailPage',
        name: 'workDetailPage',
        component: workDetailPage,
        meta: {
            required: _required
        }
    },{
        path: '/totalHomework',
        name: 'totalHomework',
        component: totalHomework,
        meta: {
            required: _required
        }
    },{
        path: '/pointAllQuestion',
        name: 'pointAllQuestion',
        component: pointAllQuestion,
        meta: {
            required: _required
        }
    },{
        path: '/appoint',
        name: 'appoint',
        component: appoint,
        meta: {
            required: _required
        }
    },{
        path: '/analyse',
        name: 'analyse',
        component: analyse,
        meta: {
            required: _required
        }
    },{
        path: '/error',
        name: 'error',
        component: error,
        meta: {
            required: _required
        }
    },{
        path: '/collection',
        name: 'collection',
        component: collection,
        meta: {
            required: _required
        }
    },{
        path: '/message',
        name: 'message',
        component: message,
        meta: {
            required: _required
        }
    },{
        path: '/check',
        name: 'check',
        component: checkApply,
        meta: {
            required: _required
        }
    },{
        path: '/apply',
        name: 'apply',
        component: apply,
        meta: {
            required: _required
        }
    },{
        path: '/path',
        name: 'path',
        component: path,
        meta: {
            required: _required
        }
    },{
        path: '/question/:menu',
        name: 'question',
        component: question,
        meta: {
            required: _required
        }
    },{
        path: '/allquestion',
        name: 'allquestion',
        component: allquestion,
        meta: {
            required: _required
        }
    },{
        path: '/allanswer',
        name: 'allanswer',
        component: allanswer,
        meta: {
            required: _required
        }
    },{
        path: '/login',
        name: 'login',
        component: Login
    }, {
        path: '/runnob',
        name: 'runnob',
        component: runnob,
        meta: {
            required: _required
        }
    }, {
        path: '/person',
        name: 'person',
        component: person,
        meta: {
            required: _required
        }
    }, {
        path: '/change_pass',
        name: 'change_pass',
        component: change_pass,
        meta: {
            required: _required
        }
    }, {
        path: '/homework',
        name: 'homework',
        component: homework,
        meta: {
            required: _required
        }
    }, {
        path: '/doHomework',
        name: 'doHomework',
        component: doHomework,
        meta: {
            required: _required
        }
    },{
        path: '/normalHomework',
        name: 'normalHomework',
        component: normalHomework,
        meta: {
            required: _required
        }
    }, {
        path: '/signin',
        name: 'signin',
        component: Signin
    }, {
        path: '/wechat',
        name: 'wechat',
        component: wechat
    }, {
        path: '/giveQuestion/:position?/:seq?/:state/:question?/:_id?',
        name: 'giveQuestion',
        component: give_question,
        meta: {
            required: _required
        }
    },{
        path: '/edit_point',
        name: 'edit_point',
        component: edit_point,
        meta: {
            required: _required
        }
    },{
        path: '/more_point/:state/:position/:seq/:point?',
        name: 'more_point',
        component: more_point,
        meta: {
            required: _required
        }
    },{
        path: '/feedback',
        name: 'feedback',
        component: feedback,
        meta: {
            required: _required
        }
    },{
        path: '/refindPass',
        name: 'refindPass',
        component: refindpass
    },{
        path: '/:menu?',
        name: 'index',
        component: Index,
        meta: {
            required: _required
        }
    }]
})